﻿Public Class NoQuarterState
    Implements IState
    Private _machine As GumballMachine

    Public Sub New(ByVal machine As GumballMachine)
        _machine = machine
    End Sub

    Public Sub dispense() Implements IState.dispense
        Console.WriteLine("You need to pay first")
    End Sub

    Public Sub ejectQuarter() Implements IState.ejectQuarter
        Console.WriteLine("You haven't inserted a quarter")
    End Sub

    Public Sub insertQuarter() Implements IState.insertQuarter
        Console.WriteLine("You inserted a quarter")
        _machine.CurrentState = _machine.HasQuarterState
    End Sub

    Public Sub turnCrank() Implements IState.turnCrank
        Console.WriteLine("You turned, but there's no quarter")
    End Sub

    Public Overrides Function ToString() As String
        Return "waiting for quarter"
    End Function
End Class
